package org.hard.model.structure.adapter;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author: 王林博
 * @date: 2023年02月16日 14:45
 */

@EqualsAndHashCode(callSuper = true)
public class SquarePegAdapter extends RoundPeg{

    private SquarePeg squarePeg;

    public SquarePegAdapter(SquarePeg squarePeg){
        super(squarePeg.width);
        this.squarePeg = squarePeg;
    }

    @Override
    public Integer getRadius(){
        return (int)(squarePeg.getWidth() * Math.sqrt(2) / 2);
    }
}
